home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DBVGAL17.ARJ / SRC_C.ARJ / VTEXT.C < prev   
C/C++ Source or Header  |  1992-01-26  |  1KB  |  65 lines

  1. #include <dos.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <conio.h>
  6. #include <mem.h>
  7. #include "vidlib.h"
  8.  
  9. void L40set(void);
  10.  
  11. int _select_scanline_count(int scans)
  12. {
  13.    union REGS r;
  14.    if ((scans != 200)&&(scans != 350)&&(scans != 400))
  15.       return(0);
  16.    r.h.ah=0x12;
  17.    r.h.al=(unsigned char)scans;
  18.    int86(0x10,&r,&r);
  19.    return(r.h.al);
  20. }
  21.  
  22. int _select_character_points(int points)
  23. {
  24.    union REGS r;
  25.    if ( points == 16 ) {
  26.       r.x.ax=0x1114;
  27.       r.h.bl=0;
  28.       int86(0x10,&r,&r);
  29.       return(1);
  30.    }
  31.    if ( points == 14 ) {
  32.       r.x.ax=0x1111;
  33.       r.h.bl=0;
  34.       int86(0x10,&r,&r);
  35.       return(1);
  36.    }
  37.    if ( points == 8 ) {
  38.       r.x.ax=0x1112;
  39.       r.h.bl=0;
  40.       int86(0x10,&r,&r);
  41.       return(1);
  42.    }
  43.    return(0);
  44. }
  45.  
  46. int Textmode(int lines)
  47. {
  48.     _select_scanline_count(400);
  49.     VGAmode(3, NULL); /* default to 25 */
  50.     switch (lines) {
  51.        case 25:    break; /* already 25 */
  52.        case 28:    _select_character_points(14); break;
  53.        case 33:    L33set();
  54.                    BIOScrtbuflen=0x2000; /* allow 8k pages */
  55.                    break;
  56.        case 40:    L40set();
  57.                    BIOScrtbuflen=0x4000;  /* allow 16k pages */
  58.                    break;
  59.        case 50:    _select_character_points(8);  break;
  60.     }
  61.     return(BIOScrtrows+1);
  62. }
  63.  
  64.  
  65.